/*
 * @Author: your name
 * @Date: 2020-01-27 17:43:51
 * @LastEditTime: 2020-07-06 21:36:19
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \vue-element-admin\src\api\user.js
 */
import request from '@/utils/request'

//查询所有隐患信息信息
export function fetchList(data) {
  return request({
    url: '/api/company-danger/getPage',
    method: 'post',
    data
  })
}
//查询隐患详细信息
export function fetchTroubleDetail(query) {
  return request({
    url: '/api/company-danger/detail',
    method: 'get',
    params: query
  })
}
//隐患统计信息根据公司或者开始时间，结束时间
export function fetchTroubleTable(query) {
  return request({
    url: '/api/company-danger/dangerCount',
    method: 'get',
    params: query
  })
}

//新增隐患
export function addTrouble(data) {
  return request({
    url: '/api/company-danger/add',
    method: 'post',
    data,
    headers: {
      "Content-Type": "multipart/form-data"
    }
  })
}
//编辑隐患editTrouble
export function editTrouble(data) {
  return request({
    url: '/api/company-danger/edit',
    method: 'post',
    data,
    headers: {
      "Content-Type": "multipart/form-data"
    }
  })
}
//删除隐患
export function deleteTrouble(data) {
  return request({
    url: '/api/company-danger/delete',
    method: 'post',
    data
  })
}

//企业接收隐患
export function takeTrouble(data) {
  return request({
    url: '/api/company-danger/CompanyTakeDanger',
    method: 'post',
    data
  })
}

//新增整改
export function addRecitfy(data) {
  return request({
    url: '/api/company-danger-rectify/add',
    method: 'post',
    data,
    headers: {
      "Content-Type": "multipart/form-data"
    }
  })
}

//新增复查addReview
export function addReview(data) {
  return request({
    url: '/api/company-danger-review/add',
    method: 'post',
    data,
    headers: {
      "Content-Type": "multipart/form-data"
    }
  })
}

//查询所有企业最高隐患级别
export function fetchEnterpriseDangerList() {
  return request({
    url: '/api/company-danger/getHightLevelDanger',
    method: 'get',
  })
}

//隐患上报
export function isReportDanger(query) {
  return request({
    url: '/api/company-danger/dangerReport',
    method: 'get',
    params: query
  })
}
